﻿using System;

namespace Unity.String
{
    static class StringFormatterException
    {
        internal static void ThrowArgumentException(string paramName)
        {
            throw new ArgumentException("Can't format argument", paramName);
        }

        internal static void ThrowIndexException(int index, int length)
        {
            throw new ArgumentException("Index (zero based) must be grater than or equal to zero and less than the size of the format length", $"index = {index}, length = {length}");
        }

        internal static void ThrowFormatException()
        {
            throw new FormatException("Index (zero based) must be greater than or equal to zero and less than the size of the argument list.");
        }

        internal static void ThrowFormatError()
        {
            throw new FormatException("Input string was not in a correct format.");
        }
    }
}
